A cache in a central processing unit is a data storage structure that is used by the central processing unit of a computer to reduce the average time that it takes to access memory. It is a memory which stores copies of data that is located in the most frequently used main memory locations. Moreover, cache memory is memory that is smaller and that may be accessed more quickly than main memory. There are several different types of caches.
In computing, cache coherence refers to the consistency of data stored in local caches of a shared resource. In a shared memory system that includes separate cache memory components, it is possible to have many copies of data: one copy in the main memory and one in one or more cache memory components. When one copy of data stored in the cache system is changed, the other copies of the data must be changed also. Cache coherence ensures that changes in the values of shared data are propagated throughout a cache system in a timely fashion. A cache system is coherent if whenever data is read, the returned value for the data is the value that is most recently written.
A coherency protocol is a protocol which maintains consistency between all the caches in a system of distributed shared memory. The protocol maintains memory coherence according to a specific consistency model. Choosing the appropriate consistency model is critical to the design of a cache coherent system. However, consistency models differ in performance and scalability. Accordingly, they should be evaluated for every cache system design for which they are considered. Designers can add features to address particular challenges presented by specific designs. Consequently, a challenge of cache system design is implementing a protocol to have features that best suit the specific design of the cache system in which it is used.